package com.monitor.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.monitor.entity.ErpTireArchivesWork;

/**
 * <p>
 * 轮胎档案工作表 Mapper 接口
 * </p>
 *
 * @author LX
 * @since 2018-09-27
 */
public interface ErpTireArchivesWorkMapper extends BaseMapper<ErpTireArchivesWork> {
	@Select("SELECT taw.* from erp_tire_archives_work taw where taw.tire_id=#{tireId} and taw.work_date<=#{workTime} order by taw.work_date")
	public List<ErpTireArchivesWork> selectByWorkDate(@Param("tireId")int tireId,@Param("workTime")String workTime);
	
	@Select("SELECT * from erp_tire_archives_work taw where taw.tire_id=#{tireId} ORDER BY taw.work_date asc, taw.id asc")
	public List<ErpTireArchivesWork> selectByTireId(@Param("tireId")int tireId);
	
	@Select("SELECT DISTINCT tire_id FROM erp_tire_archives_work WHERE customer_id=#{custId}")
	public List<Integer> selectIdByCustId(@Param("custId")int custId);
}
